package jetzhu;

public class DictionaryOrder {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     *
     * @param s string字符串
     * @return string字符串
     */
    public String maxDictionaryOrder (String s) {
        // write code here
        char[] c=s.toCharArray();
        StringBuilder stringBuilder =new StringBuilder();
        char[] subs=s.substring(0).toCharArray();
        for (int m=0;m<subs.length;m++){
            char max=subs[0];
            char[] b=String.valueOf(subs).substring(m).toCharArray();
            for (int i=m;i<b.length;i++){
                if(max <b[i])
                {
                    max=b[i];
                }
            }
            stringBuilder.append(max);
        }
        return stringBuilder.toString();
    }
}
